@extends('edu::layouts.front')
@section('content')
    <div class="content home">
        <div class="container mt-3 mt-md-5 mb-5">
            <div class="row">
                {{--                社区动态--}}
                <div class="col-12 col-sm-9 mt-2">
                    <div class="card">
                        <div class="card-header bg-white d-flex justify-content-between align-items-center">
                            社区动态
                            <a href="{{route('edu.front.topic.create')}}"
                               class="btn btn-outline-secondary btn-sm">发表</a>
                        </div>

                        <div class="card-body">
                            @foreach($activitys as $activity)
                                @include('edu::layouts.Activity.'.$activity->log_name)
                            @endforeach

                            <div class="pt-3">
                               @include('edu::layouts.paginate',['data'=>$activitys])

                            </div>
                        </div>
                    </div>

                </div>
                {{--                社区小贴--}}
                <div class="col-12 col-sm-3 mt-2">
                    @include('edu::layouts.tips')
                    <div class="card rounded shadow-sm mb-2">
                        <div class="card-header bg-white text-muted">
                            <i aria-hidden="true" class="fa fa-check-circle-o mr-1"></i>
                            学习动态
                        </div>
                        <div class="list-group list-group-flush">
                            @foreach($studys as $study)
                                <div class="list-group-item">
                                    <div class="d-flex align-items-start justify-content-start">
                                        <div class="pt-1 mr-3">
                                            <a href="{{route('edu.center.topic.index',['user'=>$study->user])}}">
                                                <img
                                                    src="{{$study->user->icon}}"
                                                    class="avatar35 rounded">
                                            </a>
                                        </div>
                                        <div class="pl-0">

                                            <a href="{{route('edu.front.video.show',['video'=>$study->video])}}"
                                               class="d-flex justify-content-between d-block mb-1">
                                                {{$study->video->title}}
                                            </a>
                                            <div class="small text-black-50">
                                                <a href="{{route('edu.center.topic.index',['user'=>$study->user])}}">
                                                    {{$study->user->name}}
                                                </a>
                                                <i class="fa fa-clock-o"></i>
                                                {{$study->created_at->diffForHumans()}}
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            @endforeach
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>



    </div>
@endsection

